package cn.com.open.itembank.common;

public enum RuleType {

    /**
     * 否（默认）
     */
    COMPLETE(1),
    /**
     * 是
     */
    TEMPLATE(2);

    private int index;

    RuleType(int idx) {
        this.index = idx;
    }

    /**
     * Gets index.
     *
     * @return the index
     */
    public int getIndex() {
        return index;
    }

    public static RuleType fromValue(int v) {
        for (RuleType c : RuleType.values()) {
            if (c.getIndex() == v) {
                return c;
            }
        }
        return null;
    }
}

